package com.acegear.horizon.domain.repository.jpa;

import com.acegear.horizon.domain.models.jpa.UserInfo;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

/**
 * Created by wangsike on 2016/12/10.
 */
public interface UserInfoRepository extends PagingAndSortingRepository<UserInfo, Long> {
    Optional<UserInfo> findByUserId(Long userId);


    @Query("select userInfo from UserInfo userInfo where userInfo.userId in :ids")
    List<UserInfo> findByUserId(@Param("ids") List<Long> ids);
}
